package com.gitee.thread.problem.task;

import com.gitee.thread.problem.entity.User;

/**
 * @author ming.yan-1
 * @version V1.0
 * @Title com.gitee.thread.problem.task
 * @Description
 * @date 2018/10/9  下午6:15
 */
public class JvmOOM implements Runnable {

    private int taskNum;

    public JvmOOM(int taskNum) {
        this.taskNum = taskNum;
    }

    @Override
    public void run() {
        while (true){
            int i =(int)(Math.random()*100);
            User user = new User(taskNum+"name"+i,taskNum+"address"+i,i,taskNum+"phone"+i);
            System.out.println("任务"+taskNum+"被线程"+Thread.currentThread().getName()+"执行中");
        }
    }
}
